package com.longshihan.lifecycler;

import android.text.InputFilter;
import android.text.Spanned;
import android.util.Log;

/**
 * Created by LONGHE001.
 *
 * @time 2019/3/27 0027
 * @des
 * @function
 */

public class Edit344Filter implements InputFilter {
    public String TAG=Edit344Filter.class.getSimpleName();
    private String rs="";
    public Edit344Filter() {}

    /**
     *
     * @param source 新输入的字符串
     * @param start 新输入的字符串起始下标，一般为0
     * @param end 	新输入的字符串终点下标，一般为source长度-1
     * @param dest 输入之前文本框内容
     * @param dstart 原内容起始坐标，一般为0
     * @param dend 原内容终点坐标，一般为dest长度-1
     * @return
     */
    @Override
    public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
        rs=rs+source.subSequence(start,end).toString();
        Log.d(TAG,"source:"+source+",start："+start+",end:"+end+",dest:"+dest+"dstart:"+dstart+",dend:"+dend+"::"+rs);
        return source.subSequence(start,end);
    }
}
